<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <title>LTable - 工单系统</title>

    <!-- begin::global styles -->
    <link rel="stylesheet" th:href="@{/vendors/bundle.css}" type="text/css">
    <!-- end::global styles -->

    <!-- begin::custom styles -->
    <link rel="stylesheet" th:href="@{/css/app.css}" type="text/css">
    <link rel="stylesheet" th:href="@{/css/custom.css}" type="text/css">
    <!-- end::custom styles -->

</head>
<body>

<!-- begin::side menu -->
<div class="side-menu">
    <div class='side-menu-body'>
        <ul>
            <li class="open">
                <a th:href="@{/index}"><i class="icon ti-home"></i> <span>首页</span> </a>
            </li>
            <li><a th:href="@{/create_order}"><i class="icon ti-paint-bucket"></i> <span>创建工单</span></a></li>
            <li><a class="active" th:href="@{/order_in_handle}"><i class="icon ti-layers-alt"></i> <span>正在处理</span> </a></li>
            <li><a th:href="@{/order_history}"><i class="icon ti-rocket"></i> <span>历史工单</span> </a></li>

            <li>
                <a data-attr="layout-builder-toggle" href="#">
                    <i class="icon ti-layout"></i>
                    <span>模式</span>
                </a>
            </li>

        </ul>
    </div>
</div>

<div th:replace="~{commons/commons::businessnavbar}"></div>
<!--主要展示内容 在main里显示-->
<!-- begin::main content -->
<main class="main-content">
    <div>
        <table class="table table-sm table-hover table-striped">
            <thead>
            <tr>
                <th>工单编号</th>
                <th>类型</th>
                <th>级别</th>
                <th>标题</th>
                <th>创建时间</th>
                <th>管理</th>
                <th>处理</th>
            </tr>
            </thead>
            <tbody >
            <tr th:each="theorder:${orders}" class="avatar-sm nav-item">
                <td th:text="${theorder.getOid()}"></td>
                <td th:text="${theorder.getOrdertype()}"></td>
                <td th:text="${theorder.getOrderlevel()}+1"></td>
                <td th:text="${theorder.getTitle()}"></td>
                <td th:text="${theorder.getCreatetime()}"></td>
                <td>
                    <form th:action="@{/kill_order/}+${theorder.getOid()}" method="post">
                        <input type="hidden" name="changeostatus" value="1">
                        <button class="btn" th:classappend="${theorder.getOstatus()==0?'btn-success':'btn-danger'}" th:text="${theorder.getOstatus()==1?'结束工单':'禁用'}"></button>
                    </form>
                </td>
                <td>
                    <form th:action="@{/order_in_handle/}+${theorder.getOid()}" method="post">
                        <button class="btn icon-block icon-block-sm icon-block-floating icon-block-outline-primary" >
                            <i class="ti-blackboard"></i>
                        </button>
                    </form>
                </td>
            </tr>

            </tbody>
        </table>
    </div>
</main>
<!-- end::main content -->

<!-- begin::global scripts -->
<script th:src="@{/vendors/bundle.js}"></script>
<!-- end::global scripts -->
<!-- begin::dashboard -->
<script th:src="@{/js/examples/dashboard.js}"></script>
<!-- end::dashboard -->

<!-- begin::custom scripts -->
<script th:src="@{/js/custom.js}"></script>
<script th:src="@{/js/app.js}"></script>
<!-- end::custom scripts -->

</body>
</html>